home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Compilers⁄Interps / GCC-2.3.3r12 / Sources / calls.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-01  |  71.7 KB  |  2,234 lines  |  [TEXT/MPS ]

  1. /* Convert function calls to rtl insns, for GNU C compiler.
  2.    Copyright (C) 1989, 1992 Free Software Foundation, Inc.
  3.  
  4. This file is part of GNU CC.
  5.  
  6. GNU CC is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. GNU CC is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GNU CC; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. #include "config.h"
  21. #include "rtl.h"
  22. #include "tree.h"
  23. #include "flags.h"
  24. #include "expr.h"
  25. #include "insn-flags.h"
  26.  
  27. /* Decide whether a function's arguments should be processed
  28.    from first to last or from last to first.  */
  29.  
  30. #ifdef STACK_GROWS_DOWNWARD
  31. #ifdef PUSH_ROUNDING
  32. #define PUSH_ARGS_REVERSED    /* If it's last to first */
  33. #endif
  34. #endif
  35.  
  36. /* Like STACK_BOUNDARY but in units of bytes, not bits.  */
  37. #define STACK_BYTES (STACK_BOUNDARY / BITS_PER_UNIT)
  38.  
  39. #ifdef APPLE_HAX
  40. extern int max_stack_used;
  41. #endif
  42.  
  43. /* Data structure and subroutines used within expand_call.  */
  44.  
  45. struct arg_data
  46. {
  47.   /* Tree node for this argument.  */
  48.   tree tree_value;
  49.   /* Current RTL value for argument, or 0 if it isn't precomputed.  */
  50.   rtx value;
  51.   /* Initially-compute RTL value for argument; only for const functions.  */
  52.   rtx initial_value;
  53.   /* Register to pass this argument in, 0 if passed on stack, or an
  54.      EXPR_LIST if the arg is to be copied into multiple different
  55.      registers.  */
  56.   rtx reg;
  57.   /* If REG was promoted from the actual mode of the argument expression,
  58.      indicates whether the promotion is sign- or zero-extended.  */
  59.   int unsignedp;
  60.   /* Number of registers to use.  0 means put the whole arg in registers.
  61.      Also 0 if not passed in registers.  */
  62.   int partial;
  63.   /* Non-zero if argument must be passed on stack.
  64.      Note that some arguments may be passed on the stack
  65.      even though pass_on_stack is zero, just because FUNCTION_ARG says so.
  66.      pass_on_stack identifies arguments that *cannot* go in registers.  */
  67.   int pass_on_stack;
  68.   /* Offset of this argument from beginning of stack-args.  */
  69.   struct args_size offset;
  70.   /* Similar, but offset to the start of the stack slot.  Different from
  71.      OFFSET if this arg pads downward.  */
  72.   struct args_size slot_offset;
  73.   /* Size of this argument on the stack, rounded up for any padding it gets,
  74.      parts of the argument passed in registers do not count.
  75.      If REG_PARM_STACK_SPACE is defined, then register parms
  76.      are counted here as well.  */
  77.   struct args_size size;
  78.   /* Location on the stack at which parameter should be stored.  The store
  79.      has already been done if STACK == VALUE.  */
  80.   rtx stack;
  81.   /* Location on the stack of the start of this argument slot.  This can
  82.      differ from STACK if this arg pads downward.  This location is known
  83.      to be aligned to FUNCTION_ARG_BOUNDARY.  */
  84.   rtx stack_slot;
  85. #ifdef ACCUMULATE_OUTGOING_ARGS
  86.   /* Place that this stack area has been saved, if needed.  */
  87.   rtx save_area;
  88. #endif
  89. };
  90.  
  91. #ifdef ACCUMULATE_OUTGOING_ARGS
  92. /* A vector of one char per byte of stack space.  A byte if non-zero if
  93.    the corresponding stack location has been used.
  94.    This vector is used to prevent a function call within an argument from
  95.    clobbering any stack already set up.  */
  96. static char *stack_usage_map;
  97.  
  98. /* Size of STACK_USAGE_MAP.  */
  99. static int highest_outgoing_arg_in_use;
  100.  
  101. /* stack_arg_under_construction is nonzero when an argument may be
  102.    initialized with a constructor call (including a C function that
  103.    returns a BLKmode struct) and expand_call must take special action
  104.    to make sure the object being constructed does not overlap the
  105.    argument list for the constructor call.  */
  106. int stack_arg_under_construction;
  107. #endif
  108.  
  109. static void store_one_arg ();
  110. extern enum machine_mode mode_for_size ();
  111.  
  112. /* Return 1 if EXP contains a call to the built-in function `alloca'.  */
  113.  
  114. static int
  115. calls_alloca (exp)
  116.      tree exp;
  117. {
  118.   register int i;
  119.   int type = TREE_CODE_CLASS (TREE_CODE (exp));
  120.   int length = tree_code_length[(int) TREE_CODE (exp)];
  121.  
  122.   /* Only expressions and references can contain calls.  */
  123.  
  124.   if (type != 'e' && type != '<' && type != '1' && type != '2' && type != 'r'
  125.       && type != 'b')
  126.     return 0;
  127.  
  128.   switch (TREE_CODE (exp))
  129.     {
  130.     case CALL_EXPR:
  131.       if (TREE_CODE (TREE_OPERAND (exp, 0)) == ADDR_EXPR
  132.       && (TREE_CODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0))
  133.           == FUNCTION_DECL)
  134.       && DECL_BUILT_IN (TREE_OPERAND (TREE_OPERAND (exp, 0), 0))
  135.       && (DECL_FUNCTION_CODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0))
  136.           == BUILT_IN_ALLOCA))
  137.     return 1;
  138.  
  139.       /* Third operand is RTL.  */
  140.       length = 2;
  141.       break;
  142.  
  143.     case SAVE_EXPR:
  144.       if (SAVE_EXPR_RTL (exp) != 0)
  145.     return 0;
  146.       break;
  147.  
  148.     case BLOCK:
  149.       {
  150.     register tree local;
  151.  
  152.     for (local = BLOCK_VARS (exp); local; local = TREE_CHAIN (local))
  153.       if (DECL_INITIAL (local) != 0 && calls_alloca (DECL_INITIAL (local)))
  154.         return 1;
  155.       }
  156.       {
  157.     register tree subblock;
  158.  
  159.     for (subblock = BLOCK_SUBBLOCKS (exp);
  160.          subblock;
  161.          subblock = TREE_CHAIN (subblock))
  162.       if (calls_alloca (subblock))
  163.         return 1;
  164.       }
  165.       return 0;
  166.  
  167.     case METHOD_CALL_EXPR:
  168.       length = 3;
  169.       break;
  170.  
  171.     case WITH_CLEANUP_EXPR:
  172.       length = 1;
  173.       break;
  174.  
  175.     case RTL_EXPR:
  176.       return 0;
  177.     }
  178.  
  179.   for (i = 0; i < length; i++)
  180.     if (TREE_OPERAND (exp, i) != 0
  181.     && calls_alloca (TREE_OPERAND (exp, i)))
  182.       return 1;
  183.  
  184.   return 0;
  185. }
  186.  
  187. /* Force FUNEXP into a form suitable for the address of a CALL,
  188.    and return that as an rtx.  Also load the static chain register
  189.    if FNDECL is a nested function.
  190.  
  191.    USE_INSNS points to a variable holding a chain of USE insns
  192.    to which a USE of the static chain
  193.    register should be added, if required.  */
  194.  
  195. rtx
  196. prepare_call_address (funexp, fndecl, use_insns)
  197.      rtx funexp;
  198.      tree fndecl;
  199.      rtx *use_insns;
  200. {
  201.   rtx static_chain_value = 0;
  202.  
  203.   funexp = protect_from_queue (funexp, 0);
  204.  
  205.   if (fndecl != 0)
  206.     /* Get possible static chain value for nested function in C. */
  207.     static_chain_value = lookup_static_chain (fndecl);
  208.  
  209.   /* Make a valid memory address and copy constants thru pseudo-regs,
  210.      but not for a constant address if -fno-function-cse.  */
  211.   if (GET_CODE (funexp) != SYMBOL_REF)
  212.     funexp = memory_address (FUNCTION_MODE, funexp);
  213.   else
  214.     {
  215. #ifndef NO_FUNCTION_CSE
  216.       if (optimize && ! flag_no_function_cse)
  217. #ifdef NO_RECURSIVE_FUNCTION_CSE
  218.     if (fndecl != current_function_decl)
  219. #endif
  220.       funexp = force_reg (TPmode, funexp);
  221. #endif
  222.     }
  223.  
  224.   if (static_chain_value != 0)
  225.     {
  226.       emit_move_insn (static_chain_rtx, static_chain_value);
  227.  
  228.       /* Put the USE insn in the chain we were passed.  It will later be
  229.      output immediately in front of the CALL insn.  */
  230.       push_to_sequence (*use_insns);
  231.       emit_insn (gen_rtx (USE, VOIDmode, static_chain_rtx));
  232.       *use_insns = get_insns ();
  233.       end_sequence ();
  234.     }
  235.  
  236.   return funexp;
  237. }
  238.  
  239. /* Generate instructions to call function FUNEXP,
  240.    and optionally pop the results.
  241.    The CALL_INSN is the first insn generated.
  242.  
  243.    FUNTYPE is the data type of the function, or, for a library call,
  244.    the identifier for the name of the call.  This is given to the
  245.    macro RETURN_POPS_ARGS to determine whether this function pops its own args.
  246.  
  247.    STACK_SIZE is the number of bytes of arguments on the stack,
  248.    rounded up to STACK_BOUNDARY; zero if the size is variable.
  249.    This is both to put into the call insn and
  250.    to generate explicit popping code if necessary.
  251.  
  252.    STRUCT_VALUE_SIZE is the number of bytes wanted in a structure value.
  253.    It is zero if this call doesn't want a structure value.
  254.  
  255.    NEXT_ARG_REG is the rtx that results from executing
  256.      FUNCTION_ARG (args_so_far, VOIDmode, void_type_node, 1)
  257.    just after all the args have had their registers assigned.
  258.    This could be whatever you like, but normally it is the first
  259.    arg-register beyond those used for args in this call,
  260.    or 0 if all the arg-registers are used in this call.
  261.    It is passed on to `gen_call' so you can put this info in the call insn.
  262.  
  263.    VALREG is a hard register in which a value is returned,
  264.    or 0 if the call does not return a value.
  265.  
  266.    OLD_INHIBIT_DEFER_POP is the value that `inhibit_defer_pop' had before
  267.    the args to this call were processed.
  268.    We restore `inhibit_defer_pop' to that value.
  269.  
  270.    USE_INSNS is a chain of USE insns to be emitted immediately before
  271.    the actual CALL insn.
  272.  
  273.    IS_CONST is true if this is a `const' call.  */
  274.  
  275. #if defined(APPLE_HAX) && defined(PTR_HACK)
  276. #define PTRHACK(X,Y) X
  277. #else
  278. #define PTRHACK(X,Y) Y
  279. #endif
  280.  
  281. void
  282. emit_call_1 (funexp, funtype, stack_size, struct_value_size, next_arg_reg,
  283.          valreg, old_inhibit_defer_pop, use_insns, is_const,
  284.          is_pascal, pascal_return_mode, structure_value_addr)
  285.      rtx funexp;
  286.      tree funtype;
  287.      int stack_size;
  288.      int struct_value_size;
  289.      rtx next_arg_reg;
  290.      rtx valreg;
  291.      int old_inhibit_defer_pop;
  292.      rtx use_insns;
  293.      int is_const;
  294.      /* Declarations of the extra parameters needed for Apple hacks
  295.     to emit_call_1. */
  296.      int is_pascal;
  297.      enum machine_mode pascal_return_mode;
  298.      rtx structure_value_addr;
  299. {
  300.   rtx stack_size_rtx = GEN_INT (stack_size);
  301.   rtx struct_value_size_rtx = GEN_INT (struct_value_size);
  302.   rtx call_insn;
  303.   int already_popped = 0;
  304.  
  305.   /* Ensure address is valid.  SYMBOL_REF is already valid, so no need,
  306.      and we don't want to load it into a register as an optimization,
  307.      because prepare_call_address already did it if it should be done.  */
  308.   if (GET_CODE (funexp) != SYMBOL_REF)
  309.     funexp = memory_address (FUNCTION_MODE, funexp);
  310.  
  311. #ifndef ACCUMULATE_OUTGOING_ARGS
  312. #if defined (HAVE_call_pop) && defined (HAVE_call_value_pop)
  313.   if (HAVE_call_pop && HAVE_call_value_pop
  314.       && (RETURN_POPS_ARGS (funtype, stack_size) > 0 || stack_size == 0))
  315.     {
  316.       rtx n_pop = GEN_INT (RETURN_POPS_ARGS (funtype, stack_size));
  317.       rtx pat;
  318.  
  319.       /* If this subroutine pops its own args, record that in the call insn
  320.      if possible, for the sake of frame pointer elimination.  */
  321.       if (valreg)
  322.     pat = gen_call_value_pop (valreg,
  323.                   PTRHACK(funexp, gen_rtx (MEM, FUNCTION_MODE, funexp)),
  324.                   stack_size_rtx, next_arg_reg, n_pop);
  325.       else
  326.     pat = gen_call_pop (PTRHACK(funexp, gen_rtx (MEM, FUNCTION_MODE, funexp)),
  327.                 stack_size_rtx, next_arg_reg, n_pop);
  328.  
  329.       emit_call_insn (pat);
  330.       already_popped = 1;
  331.     }
  332.   else
  333. #endif
  334. #endif
  335.  
  336. #if defined (HAVE_call) && defined (HAVE_call_value)
  337.   if (HAVE_call && HAVE_call_value)
  338.     {
  339.       if (valreg)
  340.     emit_call_insn (gen_call_value (valreg,
  341.                     PTRHACK(funexp, gen_rtx (MEM, FUNCTION_MODE, funexp)),
  342.                     stack_size_rtx, next_arg_reg));
  343.       else
  344.     emit_call_insn (gen_call (PTRHACK(funexp, gen_rtx (MEM, FUNCTION_MODE, funexp)),
  345.                   stack_size_rtx, next_arg_reg,
  346.                   struct_value_size_rtx));
  347.     }
  348.   else
  349. #endif
  350.     abort ();
  351.  
  352.   /* Find the CALL insn we just emitted and write the USE insns before it.  */
  353.   for (call_insn = get_last_insn ();
  354.        call_insn && GET_CODE (call_insn) != CALL_INSN;
  355.        call_insn = PREV_INSN (call_insn))
  356.     ;
  357.  
  358.   if (! call_insn)
  359.     abort ();
  360.  
  361.   /* Put the USE insns before the CALL.  */
  362.   emit_insns_before (use_insns, call_insn);
  363.  
  364.   /* If this is a const call, then set the insn's unchanging bit.  */
  365.   if (is_const)
  366.     CONST_CALL_P (call_insn) = 1;
  367.  
  368. #ifdef SPECIAL_CALLING_CONVENTIONS
  369.   /* If we're calling a pascal-declared function, generate an instruction
  370.      to put the return result into the correct register, and adjust the
  371.      perceived value of the stack. */
  372.   if (flag_apple
  373.       && is_pascal
  374.       && (funtype == NULL
  375.       || TYPE_CALL_CONVENTION (funtype) == NULL
  376.       || TYPE_CALL_CONVENTION (funtype)->return_regno < 0))
  377.     {
  378.       int adjsize;
  379.  
  380.       if (valreg) 
  381.     emit_move_insn(valreg,
  382.                gen_rtx(MEM, GET_MODE (valreg),
  383. #ifdef HAVE_POST_INCREMENT
  384.                    gen_rtx (POST_INC, DPmode,
  385.                     stack_pointer_rtx)
  386. #else
  387.                    gen_rtx (PLUS, DPmode,
  388.                     gen_rtx (CONST_INT, DPmode, 1),
  389.                     stack_pointer_rtx)
  390. #endif
  391.                    ));
  392. #ifndef HAVE_POST_INCREMENT
  393.       /* Whether or not the result was put anywhere, the stack still
  394.      needs to be adjusted to account for the result space alloc. */
  395.       adjsize = GET_MODE_SIZE (pascal_return_mode);
  396. #ifdef PUSH_ROUNDING
  397.       /* Be sure to round properly! */
  398.       adjsize = PUSH_ROUNDING (adjsize);
  399. #endif
  400.       if (flag_defer_pop && inhibit_defer_pop == 0)
  401.     pending_stack_adjust += adjsize;
  402.       else
  403.     adjust_stack (gen_rtx (CONST_INT, VOIDmode, adjsize));
  404. #endif /* n HAVE_POST_INCREMENT */
  405.       /* Pascal routines pop their args themselves, and we just popped any
  406.      return value, so nothing at all is left on the stack now. */
  407.       stack_size = 0;
  408.     }
  409. #endif
  410.  
  411. #ifndef ACCUMULATE_OUTGOING_ARGS
  412.   /* If returning from the subroutine does not automatically pop the args,
  413.      we need an instruction to pop them sooner or later.
  414.      Perhaps do it now; perhaps just record how much space to pop later.
  415.  
  416.      If returning from the subroutine does pop the args, indicate that the
  417.      stack pointer will be changed.  */
  418.  
  419.   if (stack_size != 0 && RETURN_POPS_ARGS (funtype, stack_size) > 0)
  420.     {
  421.       if (!already_popped)
  422.     emit_insn (gen_rtx (CLOBBER, VOIDmode, stack_pointer_rtx));
  423.       stack_size -= RETURN_POPS_ARGS (funtype, stack_size);
  424.       stack_size_rtx = GEN_INT (stack_size);
  425.     }
  426.  
  427.   if (stack_size != 0)
  428.     {
  429.       if (flag_defer_pop && inhibit_defer_pop == 0)
  430.     pending_stack_adjust += stack_size;
  431.       else
  432.     adjust_stack (stack_size_rtx);
  433.     }
  434. #endif
  435. #ifdef APPLE_HAX
  436.   /* ? */
  437.   if (stack_size > max_stack_used) max_stack_used = stack_size;
  438. #endif
  439. #ifdef PTR_HACK
  440.     if (structure_value_addr)
  441.       if (flag_defer_pop && inhibit_defer_pop == 0)
  442.         pending_stack_adjust += GET_MODE_SIZE (DPmode);
  443.       else
  444.         adjust_stack (gen_rtx (CONST_INT, VOIDmode, GET_MODE_SIZE (DPmode)));
  445. #endif
  446.  
  447.   inhibit_defer_pop = old_inhibit_defer_pop;
  448. }
  449.  
  450. /* Generate all the code for a function call
  451.    and return an rtx for its value.
  452.    Store the value in TARGET (specified as an rtx) if convenient.
  453.    If the value is stored in TARGET then TARGET is returned.
  454.    If IGNORE is nonzero, then we ignore the value of the function call.  */
  455.  
  456. rtx
  457. expand_call (exp, target, ignore)
  458.      tree exp;
  459.      rtx target;
  460.      int ignore;
  461. {
  462.   /* List of actual parameters.  */
  463.   tree actparms = TREE_OPERAND (exp, 1);
  464.   /* RTX for the function to be called.  */
  465.   rtx funexp;
  466.   /* Tree node for the function to be called (not the address!).  */
  467.   tree funtree;
  468.   /* Data type of the function.  */
  469.   tree funtype;
  470.   /* Declaration of the function being called,
  471.      or 0 if the function is computed (not known by name).  */
  472.   tree fndecl = 0;
  473.   char *name = 0;
  474.  
  475.   /* Register in which non-BLKmode value will be returned,
  476.      or 0 if no value or if value is BLKmode.  */
  477.   rtx valreg;
  478.   /* Address where we should return a BLKmode value;
  479.      0 if value not BLKmode.  */
  480.   rtx structure_value_addr = 0;
  481.   /* Nonzero if that address is being passed by treating it as
  482.      an extra, implicit first parameter.  Otherwise,
  483.      it is passed by being copied directly into struct_value_rtx.  */
  484.   int structure_value_addr_parm = 0;
  485.   /* Size of aggregate value wanted, or zero if none wanted
  486.      or if we are using the non-reentrant PCC calling convention
  487.      or expecting the value in registers.  */
  488.   int struct_value_size = 0;
  489.   /* Nonzero if called function returns an aggregate in memory PCC style,
  490.      by returning the address of where to find it.  */
  491.   int pcc_struct_value = 0;
  492.  
  493.   /* Number of actual parameters in this call, including struct value addr.  */
  494.   int num_actuals;
  495.   /* Number of named args.  Args after this are anonymous ones
  496.      and they must all go on the stack.  */
  497.   int n_named_args;
  498.   /* Count arg position in order args appear.  */
  499.   int argpos;
  500.  
  501.   /* Vector of information about each argument.
  502.      Arguments are numbered in the order they will be pushed,
  503.      not the order they are written.  */
  504.   struct arg_data *args;
  505.  
  506.   /* Total size in bytes of all the stack-parms scanned so far.  */
  507.   struct args_size args_size;
  508.   /* Size of arguments before any adjustments (such as rounding).  */
  509.   struct args_size original_args_size;
  510.   /* Data on reg parms scanned so far.  */
  511.   CUMULATIVE_ARGS args_so_far;
  512.   /* Nonzero if a reg parm has been scanned.  */
  513.   int reg_parm_seen;
  514.  
  515.   /* Nonzero if we must avoid push-insns in the args for this call. 
  516.      If stack space is allocated for register parameters, but not by the
  517.      caller, then it is preallocated in the fixed part of the stack frame.
  518.      So the entire argument block must then be preallocated (i.e., we
  519.      ignore PUSH_ROUNDING in that case).  */
  520.  
  521. #if defined(REG_PARM_STACK_SPACE) && ! defined(OUTGOING_REG_PARM_STACK_SPACE)
  522.   int must_preallocate = 1;
  523. #else
  524. #ifdef PUSH_ROUNDING
  525.   int must_preallocate = 0;
  526. #else
  527.   int must_preallocate = 1;
  528. #endif
  529. #endif
  530.  
  531.   /* Size of the stack reserved for parameter registers.  */
  532.   int reg_parm_stack_space = 0;
  533.  
  534.   /* 1 if scanning parms front to back, -1 if scanning back to front.  */
  535.   int inc;
  536.   /* Address of space preallocated for stack parms
  537.      (on machines that lack push insns), or 0 if space not preallocated.  */
  538.   rtx argblock = 0;
  539.  
  540.   /* Nonzero if it is plausible that this is a call to alloca.  */
  541.   int may_be_alloca;
  542.   /* Nonzero if this is a call to setjmp or a related function.  */
  543.   int returns_twice;
  544.   /* Nonzero if this is a call to `longjmp'.  */
  545.   int is_longjmp;
  546.   /* Nonzero if this is a call to an inline function.  */
  547.   int is_integrable = 0;
  548.   /* Nonzero if this is a call to a pascal-declared function. */
  549.   int is_pascal = 0;
  550.   /* The mode of the value being returned by a pascal-declared function. */
  551.   enum machine_mode pascal_return_mode = VOIDmode;
  552.   /* Nonzero if this is a call to a `const' function.
  553.      Note that only explicitly named functions are handled as `const' here.  */
  554.   int is_const = 0;
  555.   /* Nonzero if this is a call to a `volatile' function.  */
  556.   int is_volatile = 0;
  557. #if defined(ACCUMULATE_OUTGOING_ARGS) && defined(REG_PARM_STACK_SPACE)
  558.   /* Define the boundary of the register parm stack space that needs to be
  559.      save, if any.  */
  560.   int low_to_save = -1, high_to_save;
  561.   rtx save_area = 0;        /* Place that it is saved */
  562. #endif
  563.  
  564. #ifdef ACCUMULATE_OUTGOING_ARGS
  565.   int initial_highest_arg_in_use = highest_outgoing_arg_in_use;
  566.   char *initial_stack_usage_map = stack_usage_map;
  567. #endif
  568.  
  569.   rtx old_stack_level = 0;
  570.   int old_pending_adj;
  571.   int old_stack_arg_under_construction;
  572.   int old_inhibit_defer_pop = inhibit_defer_pop;
  573.   tree old_cleanups = cleanups_this_call;
  574.  
  575.   rtx use_insns = 0;
  576.  
  577.   register tree p;
  578.   register int i;
  579.  
  580.   /* See if we can find a DECL-node for the actual function.
  581.      As a result, decide whether this is a call to an integrable function.  */
  582.  
  583.   p = TREE_OPERAND (exp, 0);
  584.   if (TREE_CODE (p) == ADDR_EXPR)
  585.     {
  586.       fndecl = TREE_OPERAND (p, 0);
  587.       if (TREE_CODE (fndecl) != FUNCTION_DECL)
  588.     {
  589.       /* May still be a `const' function if it is
  590.          a call through a pointer-to-const.
  591.          But we don't handle that.  */
  592.       fndecl = 0;
  593.     }
  594.       else
  595.     {
  596.       if (!flag_no_inline
  597.           && fndecl != current_function_decl
  598.           && DECL_SAVED_INSNS (fndecl))
  599.         is_integrable = 1;
  600.       else if (! TREE_ADDRESSABLE (fndecl))
  601.         {
  602.           /* In case this function later becomes inlineable,
  603.          record that there was already a non-inline call to it.
  604.  
  605.          Use abstraction instead of setting TREE_ADDRESSABLE
  606.          directly.  */
  607.           if (DECL_INLINE (fndecl) && extra_warnings && !flag_no_inline)
  608.         warning_with_decl (fndecl, "can't inline call to `%s' which was declared inline");
  609.           mark_addressable (fndecl);
  610.         }
  611.  
  612.       if (TREE_READONLY (fndecl) && ! TREE_THIS_VOLATILE (fndecl)
  613.           && TYPE_MODE (TREE_TYPE (exp)) != VOIDmode)
  614.         is_const = 1;
  615. #ifdef TYPE_CALL_CONVENTION_PASCAL
  616.       /* See if the declaration included `pascal' in it. */
  617.       if (flag_apple
  618.           && (TREE_PASCAL (fndecl)
  619.                || (TYPE_CALL_CONVENTION (TREE_TYPE (fndecl)) != NULL
  620.              && TYPE_CALL_CONVENTION_PASCAL (TREE_TYPE (fndecl)))))
  621.         is_pascal = 1;
  622. #endif
  623.     }
  624.     }
  625.  
  626.   is_volatile = TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (p)));
  627.  
  628. #ifdef REG_PARM_STACK_SPACE
  629. #ifdef MAYBE_REG_PARM_STACK_SPACE
  630.   reg_parm_stack_space = MAYBE_REG_PARM_STACK_SPACE;
  631. #else
  632.   reg_parm_stack_space = REG_PARM_STACK_SPACE (fndecl);
  633. #endif
  634. #endif
  635.  
  636.   /* Warn if this value is an aggregate type,
  637.      regardless of which calling convention we are using for it.  */
  638.   if (warn_aggregate_return
  639.       && (TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE
  640.       || TREE_CODE (TREE_TYPE (exp)) == UNION_TYPE
  641.       || TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE))
  642.     warning ("function call has aggregate value");
  643.  
  644.   /* Set up a place to return a structure.  */
  645.  
  646.   /* Cater to broken compilers.  */
  647.   if (aggregate_value_p (exp))
  648.     {
  649.       /* This call returns a big structure.  */
  650.       is_const = 0;
  651.  
  652. #ifdef PCC_STATIC_STRUCT_RETURN
  653.       if (flag_pcc_struct_return)
  654.     {
  655.       pcc_struct_value = 1;
  656.       is_integrable = 0;  /* Easier than making that case work right.  */
  657.     }
  658.       else
  659. #endif
  660.     {
  661.       struct_value_size = int_size_in_bytes (TREE_TYPE (exp));
  662.  
  663.       if (struct_value_size < 0)
  664.         abort ();
  665.  
  666.       if (target && GET_CODE (target) == MEM)
  667.         structure_value_addr = XEXP (target, 0);
  668.       else
  669.         {
  670.           /* Assign a temporary on the stack to hold the value.  */
  671.  
  672.           /* For variable-sized objects, we must be called with a target
  673.          specified.  If we were to allocate space on the stack here,
  674.          we would have no way of knowing when to free it.  */
  675.  
  676.           structure_value_addr
  677.         = XEXP (assign_stack_temp (BLKmode, struct_value_size, 1), 0);
  678.           target = 0;
  679.         }
  680.     }
  681.     }
  682.  
  683.   /* If called function is inline, try to integrate it.  */
  684.  
  685.   if (is_integrable)
  686.     {
  687.       rtx temp;
  688.       rtx before_call = get_last_insn ();
  689.  
  690.       temp = expand_inline_function (fndecl, actparms, target,
  691.                      ignore, TREE_TYPE (exp),
  692.                      structure_value_addr);
  693.  
  694.       /* If inlining succeeded, return.  */
  695.       if ((HOST_WIDE_INT) temp != -1)
  696.     {
  697.       int i;
  698.  
  699.       /* Perform all cleanups needed for the arguments of this call
  700.          (i.e. destructors in C++).  It is ok if these destructors
  701.          clobber RETURN_VALUE_REG, because the only time we care about
  702.          this is when TARGET is that register.  But in C++, we take
  703.          care to never return that register directly.  */
  704.       expand_cleanups_to (old_cleanups);
  705.  
  706. #ifdef ACCUMULATE_OUTGOING_ARGS
  707.       /* If the outgoing argument list must be preserved, push
  708.          the stack before executing the inlined function if it
  709.          makes any calls.  */
  710.  
  711.       for (i = reg_parm_stack_space - 1; i >= 0; i--)
  712.         if (i < highest_outgoing_arg_in_use && stack_usage_map[i] != 0)
  713.           break;
  714.  
  715.       if (stack_arg_under_construction || i >= 0)
  716.         {
  717.           rtx insn = NEXT_INSN (before_call), seq;
  718.  
  719.           /* Look for a call in the inline function code.
  720.          If OUTGOING_ARGS_SIZE (DECL_SAVED_INSNS (fndecl)) is
  721.          nonzero then there is a call and it is not necessary
  722.          to scan the insns.  */
  723.  
  724.           if (OUTGOING_ARGS_SIZE (DECL_SAVED_INSNS (fndecl)) == 0)
  725.         for (; insn; insn = NEXT_INSN (insn))
  726.           if (GET_CODE (insn) == CALL_INSN)
  727.             break;
  728.  
  729.           if (insn)
  730.         {
  731.           /* Reserve enough stack space so that the largest
  732.              argument list of any function call in the inline
  733.              function does not overlap the argument list being
  734.              evaluated.  This is usually an overestimate because
  735.              allocate_dynamic_stack_space reserves space for an
  736.              outgoing argument list in addition to the requested
  737.              space, but there is no way to ask for stack space such
  738.              that an argument list of a certain length can be
  739.              safely constructed.  */
  740.  
  741.           int adjust = OUTGOING_ARGS_SIZE (DECL_SAVED_INSNS (fndecl));
  742. #ifdef REG_PARM_STACK_SPACE
  743.           /* Add the stack space reserved for register arguments
  744.              in the inline function.  What is really needed is the
  745.              largest value of reg_parm_stack_space in the inline
  746.              function, but that is not available.  Using the current
  747.              value of reg_parm_stack_space is wrong, but gives
  748.              correct results on all supported machines.  */
  749.           adjust += reg_parm_stack_space;
  750. #endif
  751.           start_sequence ();
  752.           emit_stack_save (SAVE_BLOCK, &old_stack_level, 0);
  753.           allocate_dynamic_stack_space (GEN_INT (adjust),
  754.                         NULL_RTX, BITS_PER_UNIT);
  755.           seq = get_insns ();
  756.           end_sequence ();
  757.           emit_insns_before (seq, NEXT_INSN (before_call));
  758.           emit_stack_restore (SAVE_BLOCK, old_stack_level, NULL_RTX);
  759.         }
  760.         }
  761. #endif
  762.  
  763.       /* If the result is equivalent to TARGET, return TARGET to simplify
  764.          checks in store_expr.  They can be equivalent but not equal in the
  765.          case of a function that returns BLKmode.  */
  766.       if (temp != target && rtx_equal_p (temp, target))
  767.         return target;
  768.       return temp;
  769.     }
  770.  
  771.       /* If inlining failed, mark FNDECL as needing to be compiled
  772.      separately after all.  */
  773.       mark_addressable (fndecl);
  774.     }
  775.  
  776.   /* When calling a const function, we must pop the stack args right away,
  777.      so that the pop is deleted or moved with the call.  */
  778.   if (is_const)
  779.     NO_DEFER_POP;
  780.  
  781.   function_call_count++;
  782.  
  783.   if (fndecl && DECL_NAME (fndecl))
  784.     name = IDENTIFIER_POINTER (DECL_NAME (fndecl));
  785.  
  786.   if (name)  comment ("call", name);
  787. #if 0
  788.   /* Unless it's a call to a specific function that isn't alloca,
  789.      if it has one argument, we must assume it might be alloca.  */
  790.  
  791.   may_be_alloca =
  792.     (!(fndecl != 0 && strcmp (name, "alloca"))
  793.      && actparms != 0
  794.      && TREE_CHAIN (actparms) == 0);
  795. #else
  796.   /* We assume that alloca will always be called by name.  It
  797.      makes no sense to pass it as a pointer-to-function to
  798.      anything that does not understand its behavior.  */
  799.   may_be_alloca =
  800.     (name && ((IDENTIFIER_LENGTH (DECL_NAME (fndecl)) == 6
  801.          && name[0] == 'a'
  802.          && ! strcmp (name, "alloca"))
  803.         || (IDENTIFIER_LENGTH (DECL_NAME (fndecl)) == 16
  804.             && name[0] == '_'
  805.             && ! strcmp (name, "__builtin_alloca"))));
  806. #endif
  807.  
  808.   /* See if this is a call to a function that can return more than once
  809.      or a call to longjmp.  */
  810.  
  811.   returns_twice = 0;
  812.   is_longjmp = 0;
  813.  
  814.   if (name != 0 && IDENTIFIER_LENGTH (DECL_NAME (fndecl)) <= 15)
  815.     {
  816.       char *tname = name;
  817.  
  818.       if (name[0] == '_')
  819.     tname += ((name[1] == '_' && name[2] == 'x') ? 3 : 1);
  820.  
  821.       if (tname[0] == 's')
  822.     {
  823.       returns_twice
  824.         = ((tname[1] == 'e'
  825.         && (! strcmp (tname, "setjmp")
  826.             || ! strcmp (tname, "setjmp_syscall")))
  827.            || (tname[1] == 'i'
  828.            && ! strcmp (tname, "sigsetjmp"))
  829.            || (tname[1] == 'a'
  830.            && ! strcmp (tname, "savectx")));
  831.       if (tname[1] == 'i'
  832.           && ! strcmp (tname, "siglongjmp"))
  833.         is_longjmp = 1;
  834.     }
  835.       else if ((tname[0] == 'q' && tname[1] == 's'
  836.         && ! strcmp (tname, "qsetjmp"))
  837.            || (tname[0] == 'v' && tname[1] == 'f'
  838.            && ! strcmp (tname, "vfork")))
  839.     returns_twice = 1;
  840.  
  841.       else if (tname[0] == 'l' && tname[1] == 'o'
  842.            && ! strcmp (tname, "longjmp"))
  843.     is_longjmp = 1;
  844.     }
  845.  
  846.   if (may_be_alloca)
  847.     current_function_calls_alloca = 1;
  848.  
  849.   /* Don't let pending stack adjusts add up to too much.
  850.      Also, do all pending adjustments now
  851.      if there is any chance this might be a call to alloca.  */
  852.  
  853.   if (pending_stack_adjust >= 32
  854.       || (pending_stack_adjust > 0 && may_be_alloca))
  855.     do_pending_stack_adjust ();
  856.  
  857.   /* Operand 0 is a pointer-to-function; get the type of the function.  */
  858.   funtype = TREE_TYPE (TREE_OPERAND (exp, 0));
  859.   if (TREE_CODE (funtype) != POINTER_TYPE)
  860.     abort ();
  861.   funtype = TREE_TYPE (funtype);
  862.  
  863.   /* Push the temporary stack slot level so that we can free temporaries used
  864.      by each of the arguments separately.  */
  865.   push_temp_slots ();
  866.  
  867.   /* Start updating where the next arg would go.  */
  868.   INIT_CUMULATIVE_ARGS (args_so_far, funtype, NULL_PTR);
  869.  
  870.   /* If struct_value_rtx is 0, it means pass the address
  871.      as if it were an extra parameter.  */
  872.   if (structure_value_addr && struct_value_rtx == 0)
  873.     {
  874. #ifdef ACCUMULATE_OUTGOING_ARGS
  875.       /* If the stack will be adjusted, make sure the structure address
  876.      does not refer to virtual_outgoing_args_rtx.  */
  877.       rtx temp = (stack_arg_under_construction
  878.           ? copy_addr_to_reg (structure_value_addr)
  879.           : force_reg (DPmode, structure_value_addr));
  880. #else
  881.       rtx temp = force_reg (DPmode, structure_value_addr);
  882. #endif
  883.  
  884.       actparms
  885.     = tree_cons (error_mark_node,
  886.              make_tree (build_pointer_type (TREE_TYPE (funtype)),
  887.                 temp),
  888.              actparms);
  889.       structure_value_addr_parm = 1;
  890.     }
  891.  
  892. #ifdef SPECIAL_CALLING_CONVENTIONS
  893.   if (flag_apple
  894.       && is_pascal
  895.       && funtype != NULL
  896.       && TYPE_MODE (TREE_TYPE (funtype)) != VOIDmode
  897.       && (TYPE_CALL_CONVENTION (funtype) == NULL
  898.       || TYPE_CALL_CONVENTION (funtype)->return_regno < 0))
  899.     {
  900.       if (structure_value_addr && ! structure_value_addr_parm)
  901.     {
  902.       emit_move_insn (struct_value_rtx,
  903.               force_reg (DPmode,
  904.                      force_operand (structure_value_addr, 0)));
  905.     }
  906.       else
  907.     {
  908.       int modesize;
  909.  
  910.       pascal_return_mode = TYPE_MODE (TREE_TYPE (funtype));
  911.       modesize = GET_MODE_SIZE (pascal_return_mode);
  912. #ifdef PUSH_ROUNDING
  913.       modesize = PUSH_ROUNDING (modesize);
  914. #endif
  915.       push_block (GEN_INT (modesize), 0, 0);
  916.       /* We might be able to use assign_stack_temp instead, which I think
  917.          would allow reuse of available space. */
  918.     }
  919.     }
  920. #endif
  921.  
  922.   /* Count the arguments and set NUM_ACTUALS.  */
  923.   for (p = actparms, i = 0; p; p = TREE_CHAIN (p)) i++;
  924.   num_actuals = i;
  925.  
  926.   /* Compute number of named args.
  927.      Normally, don't include the last named arg if anonymous args follow.
  928.      (If no anonymous args follow, the result of list_length
  929.      is actually one too large.)
  930.  
  931.      If SETUP_INCOMING_VARARGS is defined, this machine will be able to
  932.      place unnamed args that were passed in registers into the stack.  So
  933.      treat all args as named.  This allows the insns emitting for a specific
  934.      argument list to be independent of the function declaration.
  935.  
  936.      If SETUP_INCOMING_VARARGS is not defined, we do not have any reliable
  937.      way to pass unnamed args in registers, so we must force them into
  938.      memory.  */
  939. #ifndef SETUP_INCOMING_VARARGS
  940.   if (TYPE_ARG_TYPES (funtype) != 0)
  941.     n_named_args
  942.       = list_length (TYPE_ARG_TYPES (funtype)) - 1
  943.     /* Count the struct value address, if it is passed as a parm.  */
  944.     + structure_value_addr_parm;
  945.   else
  946. #endif
  947.     /* If we know nothing, treat all args as named.  */
  948.     n_named_args = num_actuals;
  949.  
  950.   /* Make a vector to hold all the information about each arg.  */
  951.   args = (struct arg_data *) alloca (num_actuals * sizeof (struct arg_data));
  952.   bzero (args, num_actuals * sizeof (struct arg_data));
  953.  
  954.   args_size.constant = 0;
  955.   args_size.var = 0;
  956.  
  957.   /* In this loop, we consider args in the order they are written.
  958.      We fill up ARGS from the front of from the back if necessary
  959.      so that in any case the first arg to be pushed ends up at the front.  */
  960.  
  961. #ifdef PUSH_ARGS_REVERSED
  962.   i = num_actuals - 1, inc = -1;
  963.   /* In this case, must reverse order of args
  964.      so that we compute and push the last arg first.  */
  965. #else
  966.   i = 0, inc = 1;
  967. #endif
  968.  
  969.   /* If Apple extensions are enabled, then the per-call flag is_pascal sets
  970.      arguments to be pushed in the order that they appear. */
  971.   if (flag_apple && is_pascal)
  972.     i = 0, inc = 1;
  973.  
  974.   /* I counts args in order (to be) pushed; ARGPOS counts in order written.  */
  975.   for (p = actparms, argpos = 0; p; p = TREE_CHAIN (p), i += inc, argpos++)
  976.     {
  977.       tree type = TREE_TYPE (TREE_VALUE (p));
  978.       enum machine_mode mode;
  979.  
  980.       args[i].tree_value = TREE_VALUE (p);
  981.  
  982.       /* Replace erroneous argument with constant zero.  */
  983.       if (type == error_mark_node || TYPE_SIZE (type) == 0)
  984.     args[i].tree_value = integer_zero_node, type = integer_type_node;
  985.  
  986.       /* Decide where to pass this arg.
  987.  
  988.      args[i].reg is nonzero if all or part is passed in registers.
  989.  
  990.      args[i].partial is nonzero if part but not all is passed in registers,
  991.      and the exact value says how many words are passed in registers.
  992.  
  993.      args[i].pass_on_stack is nonzero if the argument must at least be
  994.      computed on the stack.  It may then be loaded back into registers
  995.      if args[i].reg is nonzero.
  996.  
  997.      These decisions are driven by the FUNCTION_... macros and must agree
  998.      with those made by function.c.  */
  999.  
  1000. #ifdef FUNCTION_ARG_PASS_BY_REFERENCE
  1001.       /* See if this argument should be passed by invisible reference.  */
  1002.       if (FUNCTION_ARG_PASS_BY_REFERENCE (args_so_far, TYPE_MODE (type), type,
  1003.                       argpos < n_named_args))
  1004.     {
  1005.       /* We make a copy of the object and pass the address to the function
  1006.          being called.  */
  1007.       int size = int_size_in_bytes (type);
  1008.       rtx copy;
  1009.  
  1010.       if (size < 0)
  1011.         {
  1012.           /* This is a variable-sized object.  Make space on the stack
  1013.          for it.  */
  1014.           rtx size_rtx = expand_expr (size_in_bytes (type), NULL_RTX,
  1015.                       VOIDmode, 0);
  1016.  
  1017.           if (old_stack_level == 0)
  1018.         {
  1019.           emit_stack_save (SAVE_BLOCK, &old_stack_level, NULL_RTX);
  1020.           old_pending_adj = pending_stack_adjust;
  1021.           pending_stack_adjust = 0;
  1022.         }
  1023.  
  1024.           copy = gen_rtx (MEM, BLKmode,
  1025.                   allocate_dynamic_stack_space (size_rtx, NULL_RTX,
  1026.                                 TYPE_ALIGN (type)));
  1027.         }
  1028.       else
  1029.         copy = assign_stack_temp (TYPE_MODE (type), size, 1);
  1030.  
  1031.       store_expr (args[i].tree_value, copy, 0);
  1032.  
  1033.       args[i].tree_value = build1 (ADDR_EXPR, build_pointer_type (type),
  1034.                        make_tree (type, copy));
  1035.       type = build_pointer_type (type);
  1036.     }
  1037. #endif
  1038.  
  1039.       mode = TYPE_MODE (type);
  1040.  
  1041. #ifdef PROMOTE_FUNCTION_ARGS
  1042.       /* Compute the mode in which the arg is actually to be extended to.  */
  1043.       if (TREE_CODE (type) == INTEGER_TYPE || TREE_CODE (type) == ENUMERAL_TYPE
  1044.       || TREE_CODE (type) == BOOLEAN_TYPE || TREE_CODE (type) == CHAR_TYPE
  1045.       || TREE_CODE (type) == REAL_TYPE || TREE_CODE (type) == POINTER_TYPE
  1046.       || TREE_CODE (type) == OFFSET_TYPE)
  1047.     {
  1048.       int unsignedp = TREE_UNSIGNED (type);
  1049.       PROMOTE_MODE (mode, unsignedp, type);
  1050.       args[i].unsignedp = unsignedp;
  1051.     }
  1052. #endif
  1053.  
  1054.       args[i].reg = FUNCTION_ARG (args_so_far, mode, type,
  1055.                   argpos < n_named_args);
  1056. #ifdef FUNCTION_ARG_PARTIAL_NREGS
  1057.       if (args[i].reg)
  1058.     args[i].partial
  1059.       = FUNCTION_ARG_PARTIAL_NREGS (args_so_far, mode, type,
  1060.                     argpos < n_named_args);
  1061. #endif
  1062.  
  1063.       args[i].pass_on_stack = MUST_PASS_IN_STACK (mode, type);
  1064.  
  1065.       /* If FUNCTION_ARG returned an (expr_list (nil) FOO), it means that
  1066.      we are to pass this arg in the register(s) designated by FOO, but
  1067.      also to pass it in the stack.  */
  1068.       if (args[i].reg && GET_CODE (args[i].reg) == EXPR_LIST
  1069.       && XEXP (args[i].reg, 0) == 0)
  1070.     args[i].pass_on_stack = 1, args[i].reg = XEXP (args[i].reg, 1);
  1071.  
  1072.       /* If this is an addressable type, we must preallocate the stack
  1073.      since we must evaluate the object into its final location.
  1074.  
  1075.      If this is to be passed in both registers and the stack, it is simpler
  1076.      to preallocate.  */
  1077.       if (TREE_ADDRESSABLE (type)
  1078.       || (args[i].pass_on_stack && args[i].reg != 0))
  1079.     must_preallocate = 1;
  1080.  
  1081.       /* If this is an addressable type, we cannot pre-evaluate it.  Thus,
  1082.      we cannot consider this function call constant.  */
  1083.       if (TREE_ADDRESSABLE (type))
  1084.     is_const = 0;
  1085.  
  1086.       /* Compute the stack-size of this argument.  */
  1087.       if (args[i].reg == 0 || args[i].partial != 0
  1088. #ifdef REG_PARM_STACK_SPACE
  1089.       || reg_parm_stack_space > 0
  1090. #endif
  1091.       || args[i].pass_on_stack)
  1092.     locate_and_pad_parm (TYPE_MODE (type), type,
  1093. #ifdef STACK_PARMS_IN_REG_PARM_AREA
  1094.                  1,
  1095. #else
  1096.                  args[i].reg != 0,
  1097. #endif
  1098.                  fndecl, &args_size, &args[i].offset,
  1099.                  &args[i].size);
  1100.  
  1101. #ifndef ARGS_GROW_DOWNWARD
  1102.       args[i].slot_offset = args_size;
  1103. #endif
  1104.  
  1105. #ifndef REG_PARM_STACK_SPACE
  1106.       /* If a part of the arg was put into registers,
  1107.      don't include that part in the amount pushed.  */
  1108.       if (! args[i].pass_on_stack)
  1109.     args[i].size.constant -= ((args[i].partial * UNITS_PER_WORD)
  1110.                   / (PARM_BOUNDARY / BITS_PER_UNIT)
  1111.                   * (PARM_BOUNDARY / BITS_PER_UNIT));
  1112. #endif
  1113.       
  1114.       /* Update ARGS_SIZE, the total stack space for args so far.  */
  1115.  
  1116.       args_size.constant += args[i].size.constant;
  1117.       if (args[i].size.var)
  1118.     {
  1119.       ADD_PARM_SIZE (args_size, args[i].size.var);
  1120.     }
  1121.  
  1122.       /* Since the slot offset points to the bottom of the slot,
  1123.      we must record it after incrementing if the args grow down.  */
  1124. #ifdef ARGS_GROW_DOWNWARD
  1125.       args[i].slot_offset = args_size;
  1126.  
  1127.       args[i].slot_offset.constant = -args_size.constant;
  1128.       if (args_size.var)
  1129.     {
  1130.       SUB_PARM_SIZE (args[i].slot_offset, args_size.var);
  1131.     }
  1132. #endif
  1133.  
  1134.       /* Increment ARGS_SO_FAR, which has info about which arg-registers
  1135.      have been used, etc.  */
  1136.  
  1137.       FUNCTION_ARG_ADVANCE (args_so_far, TYPE_MODE (type), type,
  1138.                 argpos < n_named_args);
  1139.     }
  1140.  
  1141. #ifdef FINAL_REG_PARM_STACK_SPACE
  1142.   reg_parm_stack_space = FINAL_REG_PARM_STACK_SPACE (args_size.constant,
  1143.                              args_size.var);
  1144. #endif
  1145.       
  1146.   /* Compute the actual size of the argument block required.  The variable
  1147.      and constant sizes must be combined, the size may have to be rounded,
  1148.      and there may be a minimum required size.  */
  1149.  
  1150.   original_args_size = args_size;
  1151.   if (args_size.var)
  1152.     {
  1153.       /* If this function requires a variable-sized argument list, don't try to
  1154.      make a cse'able block for this call.  We may be able to do this
  1155.      eventually, but it is too complicated to keep track of what insns go
  1156.      in the cse'able block and which don't.  */
  1157.  
  1158.       is_const = 0;
  1159.       must_preallocate = 1;
  1160.  
  1161.       args_size.var = ARGS_SIZE_TREE (args_size);
  1162.       args_size.constant = 0;
  1163.  
  1164. #ifdef STACK_BOUNDARY
  1165.       if (STACK_BOUNDARY != BITS_PER_UNIT)
  1166.     args_size.var = round_up (args_size.var, STACK_BYTES);
  1167. #endif
  1168.  
  1169. #ifdef REG_PARM_STACK_SPACE
  1170.       if (reg_parm_stack_space > 0)
  1171.     {
  1172.       args_size.var
  1173.         = size_binop (MAX_EXPR, args_size.var,
  1174.               size_int (REG_PARM_STACK_SPACE (fndecl)));
  1175.  
  1176. #ifndef OUTGOING_REG_PARM_STACK_SPACE
  1177.       /* The area corresponding to register parameters is not to count in
  1178.          the size of the block we need.  So make the adjustment.  */
  1179.       args_size.var
  1180.         = size_binop (MINUS_EXPR, args_size.var,
  1181.               size_int (reg_parm_stack_space));
  1182. #endif
  1183.     }
  1184. #endif
  1185.     }
  1186.   else
  1187.     {
  1188. #ifdef STACK_BOUNDARY
  1189.       args_size.constant = (((args_size.constant + (STACK_BYTES - 1))
  1190.                  / STACK_BYTES) * STACK_BYTES);
  1191. #endif
  1192.  
  1193. #ifdef REG_PARM_STACK_SPACE
  1194.       args_size.constant = MAX (args_size.constant,
  1195.                 reg_parm_stack_space);
  1196. #ifndef OUTGOING_REG_PARM_STACK_SPACE
  1197.       args_size.constant -= reg_parm_stack_space;
  1198. #endif
  1199. #endif
  1200.     }
  1201.  
  1202.   /* See if we have or want to preallocate stack space.
  1203.  
  1204.      If we would have to push a partially-in-regs parm
  1205.      before other stack parms, preallocate stack space instead.
  1206.  
  1207.      If the size of some parm is not a multiple of the required stack
  1208.      alignment, we must preallocate.
  1209.  
  1210.      If the total size of arguments that would otherwise create a copy in
  1211.      a temporary (such as a CALL) is more than half the total argument list
  1212.      size, preallocation is faster.
  1213.  
  1214.      Another reason to preallocate is if we have a machine (like the m88k)
  1215.      where stack alignment is required to be maintained between every
  1216.      pair of insns, not just when the call is made.  However, we assume here
  1217.      that such machines either do not have push insns (and hence preallocation
  1218.      would occur anyway) or the problem is taken care of with
  1219.      PUSH_ROUNDING.  */
  1220.  
  1221.   if (! must_preallocate)
  1222.     {
  1223.       int partial_seen = 0;
  1224.       int copy_to_evaluate_size = 0;
  1225.  
  1226.       for (i = 0; i < num_actuals && ! must_preallocate; i++)
  1227.     {
  1228.       if (args[i].partial > 0 && ! args[i].pass_on_stack)
  1229.         partial_seen = 1;
  1230.       else if (partial_seen && args[i].reg == 0)
  1231.         must_preallocate = 1;
  1232.  
  1233.       if (TYPE_MODE (TREE_TYPE (args[i].tree_value)) == BLKmode
  1234.           && (TREE_CODE (args[i].tree_value) == CALL_EXPR
  1235.           || TREE_CODE (args[i].tree_value) == TARGET_EXPR
  1236.           || TREE_CODE (args[i].tree_value) == COND_EXPR
  1237.           || TREE_ADDRESSABLE (TREE_TYPE (args[i].tree_value))))
  1238.         copy_to_evaluate_size
  1239.           += int_size_in_bytes (TREE_TYPE (args[i].tree_value));
  1240.     }
  1241.  
  1242.       if (copy_to_evaluate_size * 2 >= args_size.constant
  1243.       && args_size.constant > 0)
  1244.     must_preallocate = 1;
  1245.     }
  1246.  
  1247.   /* If the structure value address will reference the stack pointer, we must
  1248.      stabilize it.  We don't need to do this if we know that we are not going
  1249.      to adjust the stack pointer in processing this call.  */
  1250.  
  1251.   if (structure_value_addr
  1252.       && (reg_mentioned_p (virtual_stack_dynamic_rtx, structure_value_addr)
  1253.        || reg_mentioned_p (virtual_outgoing_args_rtx, structure_value_addr))
  1254.       && (args_size.var
  1255. #ifndef ACCUMULATE_OUTGOING_ARGS
  1256.       || args_size.constant
  1257. #endif
  1258.       ))
  1259.     structure_value_addr = copy_to_reg (structure_value_addr);
  1260.  
  1261.   /* If this function call is cse'able, precompute all the parameters.
  1262.      Note that if the parameter is constructed into a temporary, this will
  1263.      cause an additional copy because the parameter will be constructed
  1264.      into a temporary location and then copied into the outgoing arguments.
  1265.      If a parameter contains a call to alloca and this function uses the
  1266.      stack, precompute the parameter.  */
  1267.  
  1268.   for (i = 0; i < num_actuals; i++)
  1269.     if (is_const
  1270.     || ((args_size.var != 0 || args_size.constant != 0)
  1271.         && calls_alloca (args[i].tree_value)))
  1272.       {
  1273.     args[i].initial_value = args[i].value
  1274.       = expand_expr (args[i].tree_value, NULL_RTX, VOIDmode, 0);
  1275.     preserve_temp_slots (args[i].value);
  1276.     free_temp_slots ();
  1277.  
  1278.     /* ANSI doesn't require a sequence point here,
  1279.        but PCC has one, so this will avoid some problems.  */
  1280.     emit_queue ();
  1281.       }
  1282.  
  1283.   /* Now we are about to start emitting insns that can be deleted
  1284.      if a libcall is deleted.  */
  1285.   if (is_const)
  1286.     start_sequence ();
  1287.  
  1288.   /* If we have no actual push instructions, or shouldn't use them,
  1289.      make space for all args right now.  */
  1290.  
  1291.   if (args_size.var != 0)
  1292.     {
  1293.       if (old_stack_level == 0)
  1294.     {
  1295.       emit_stack_save (SAVE_BLOCK, &old_stack_level, NULL_RTX);
  1296.       old_pending_adj = pending_stack_adjust;
  1297.       pending_stack_adjust = 0;
  1298. #ifdef ACCUMULATE_OUTGOING_ARGS
  1299.       /* stack_arg_under_construction says whether a stack arg is
  1300.          being constructed at the old stack level.  Pushing the stack
  1301.          gets a clean outgoing argument block.  */
  1302.       old_stack_arg_under_construction = stack_arg_under_construction;
  1303.       stack_arg_under_construction = 0;
  1304. #endif
  1305.     }
  1306.       argblock = push_block (ARGS_SIZE_RTX (args_size), 0, 0);
  1307.     }
  1308.   else if (must_preallocate)
  1309.     {
  1310.       /* Note that we must go through the motions of allocating an argument
  1311.      block even if the size is zero because we may be storing args
  1312.      in the area reserved for register arguments, which may be part of
  1313.      the stack frame.  */
  1314.       int needed = args_size.constant;
  1315.  
  1316. #ifdef ACCUMULATE_OUTGOING_ARGS
  1317.       /* Store the maximum argument space used.  It will be pushed by the
  1318.      prologue.
  1319.  
  1320.      Since the stack pointer will never be pushed, it is possible for
  1321.      the evaluation of a parm to clobber something we have already
  1322.      written to the stack.  Since most function calls on RISC machines
  1323.      do not use the stack, this is uncommon, but must work correctly.
  1324.      
  1325.      Therefore, we save any area of the stack that was already written
  1326.      and that we are using.  Here we set up to do this by making a new
  1327.      stack usage map from the old one.  The actual save will be done
  1328.      by store_one_arg. 
  1329.  
  1330.      Another approach might be to try to reorder the argument
  1331.      evaluations to avoid this conflicting stack usage.  */
  1332.  
  1333.       if (needed > current_function_outgoing_args_size)
  1334.     current_function_outgoing_args_size = needed;
  1335.  
  1336. #if defined(REG_PARM_STACK_SPACE) && ! defined(OUTGOING_REG_PARM_STACK_SPACE)
  1337.       /* Since we will be writing into the entire argument area, the
  1338.      map must be allocated for its entire size, not just the part that
  1339.      is the responsibility of the caller.  */
  1340.       needed += reg_parm_stack_space;
  1341. #endif
  1342.  
  1343. #ifdef ARGS_GROW_DOWNWARD
  1344.       highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
  1345.                      needed + 1);
  1346. #else
  1347.       highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use, needed);
  1348. #endif
  1349.       stack_usage_map = (char *) alloca (highest_outgoing_arg_in_use);
  1350.  
  1351.       if (initial_highest_arg_in_use)
  1352.     bcopy (initial_stack_usage_map, stack_usage_map,
  1353.            initial_highest_arg_in_use);
  1354.  
  1355.       if (initial_highest_arg_in_use != highest_outgoing_arg_in_use)
  1356.     bzero (&stack_usage_map[initial_highest_arg_in_use],
  1357.            highest_outgoing_arg_in_use - initial_highest_arg_in_use);
  1358.       needed = 0;
  1359.  
  1360.       /* The address of the outgoing argument list must not be copied to a
  1361.      register here, because argblock would be left pointing to the
  1362.      wrong place after the call to allocate_dynamic_stack_space below. */
  1363.  
  1364.       argblock = virtual_outgoing_args_rtx;
  1365.  
  1366. #else /* not ACCUMULATE_OUTGOING_ARGS */
  1367.       if (inhibit_defer_pop == 0)
  1368.     {
  1369.       /* Try to reuse some or all of the pending_stack_adjust
  1370.          to get this space.  Maybe we can avoid any pushing.  */
  1371.       if (needed > pending_stack_adjust)
  1372.         {
  1373.           needed -= pending_stack_adjust;
  1374.           pending_stack_adjust = 0;
  1375.         }
  1376.       else
  1377.         {
  1378.           pending_stack_adjust -= needed;
  1379.           needed = 0;
  1380.         }
  1381.     }
  1382.       /* Special case this because overhead of `push_block' in this
  1383.      case is non-trivial.  */
  1384.       if (needed == 0)
  1385.     argblock = virtual_outgoing_args_rtx;
  1386.       else
  1387.     argblock = push_block (GEN_INT (needed), 0, 0);
  1388.  
  1389.       /* We only really need to call `copy_to_reg' in the case where push
  1390.      insns are going to be used to pass ARGBLOCK to a function
  1391.      call in ARGS.  In that case, the stack pointer changes value
  1392.      from the allocation point to the call point, and hence
  1393.      the value of VIRTUAL_OUTGOING_ARGS_RTX changes as well.
  1394.      But might as well always do it.  */
  1395.       argblock = copy_to_reg (argblock);
  1396. #endif /* not ACCUMULATE_OUTGOING_ARGS */
  1397.     }
  1398.  
  1399.  
  1400. #ifdef ACCUMULATE_OUTGOING_ARGS
  1401.   /* The save/restore code in store_one_arg handles all cases except one:
  1402.      a constructor call (including a C function returning a BLKmode struct)
  1403.      to initialize an argument.  */
  1404.   if (stack_arg_under_construction)
  1405.     {
  1406. #if defined(REG_PARM_STACK_SPACE) && ! defined(OUTGOING_REG_PARM_STACK_SPACE)
  1407.       rtx push_size = GEN_INT (reg_parm_stack_space + args_size.constant);
  1408. #else
  1409.       rtx push_size = GEN_INT (args_size.constant);
  1410. #endif
  1411.       if (old_stack_level == 0)
  1412.     {
  1413.       emit_stack_save (SAVE_BLOCK, &old_stack_level, NULL_RTX);
  1414.       old_pending_adj = pending_stack_adjust;
  1415.       pending_stack_adjust = 0;
  1416.       /* stack_arg_under_construction says whether a stack arg is
  1417.          being constructed at the old stack level.  Pushing the stack
  1418.          gets a clean outgoing argument block.  */
  1419.       old_stack_arg_under_construction = stack_arg_under_construction;
  1420.       stack_arg_under_construction = 0;
  1421.       /* Make a new map for the new argument list.  */
  1422.       stack_usage_map = (char *)alloca (highest_outgoing_arg_in_use);
  1423.       bzero (stack_usage_map, highest_outgoing_arg_in_use);
  1424.       highest_outgoing_arg_in_use = 0;
  1425.     }
  1426.       allocate_dynamic_stack_space (push_size, NULL_RTX, BITS_PER_UNIT);
  1427.     }
  1428.   /* If argument evaluation might modify the stack pointer, copy the
  1429.      address of the argument list to a register.  */
  1430.   for (i = 0; i < num_actuals; i++)
  1431.     if (args[i].pass_on_stack)
  1432.       {
  1433.     argblock = copy_addr_to_reg (argblock);
  1434.     break;
  1435.       }
  1436. #endif
  1437.  
  1438.  
  1439.   /* If we preallocated stack space, compute the address of each argument.
  1440.      We need not ensure it is a valid memory address here; it will be 
  1441.      validized when it is used.  */
  1442.   if (argblock)
  1443.     {
  1444.       rtx arg_reg = argblock;
  1445.       int arg_offset = 0;
  1446.  
  1447.       if (GET_CODE (argblock) == PLUS)
  1448.     arg_reg = XEXP (argblock, 0), arg_offset = INTVAL (XEXP (argblock, 1));
  1449.  
  1450.       for (i = 0; i < num_actuals; i++)
  1451.     {
  1452.       rtx offset = ARGS_SIZE_RTX (args[i].offset);
  1453.       rtx slot_offset = ARGS_SIZE_RTX (args[i].slot_offset);
  1454.       rtx addr;
  1455.  
  1456.       /* Skip this parm if it will not be passed on the stack.  */
  1457.       if (! args[i].pass_on_stack && args[i].reg != 0)
  1458.         continue;
  1459.  
  1460.       if (GET_CODE (offset) == CONST_INT)
  1461.         addr = plus_constant (arg_reg, INTVAL (offset));
  1462.       else
  1463.         addr = gen_rtx (PLUS, DPmode, arg_reg, offset);
  1464.  
  1465.       addr = plus_constant (addr, arg_offset);
  1466.       args[i].stack
  1467.         = gen_rtx (MEM, TYPE_MODE (TREE_TYPE (args[i].tree_value)), addr);
  1468.  
  1469.       if (GET_CODE (slot_offset) == CONST_INT)
  1470.         addr = plus_constant (arg_reg, INTVAL (slot_offset));
  1471.       else
  1472.         addr = gen_rtx (PLUS, DPmode, arg_reg, slot_offset);
  1473.  
  1474.       addr = plus_constant (addr, arg_offset);
  1475.       args[i].stack_slot
  1476.         = gen_rtx (MEM, TYPE_MODE (TREE_TYPE (args[i].tree_value)), addr);
  1477.     }
  1478.     }
  1479.                            
  1480. #ifdef PUSH_ARGS_REVERSED
  1481. #ifdef STACK_BOUNDARY
  1482.   /* If we push args individually in reverse order, perform stack alignment
  1483.      before the first push (the last arg).  */
  1484.   if (argblock == 0)
  1485.     anti_adjust_stack (GEN_INT (args_size.constant
  1486.                 - original_args_size.constant));
  1487. #endif
  1488. #endif
  1489.  
  1490.   /* Don't try to defer pops if preallocating, not even from the first arg,
  1491.      since ARGBLOCK probably refers to the SP.  */
  1492.   if (argblock)
  1493.     NO_DEFER_POP;
  1494.  
  1495.   /* Get the function to call, in the form of RTL.  */
  1496.   if (fndecl)
  1497.     /* Get a SYMBOL_REF rtx for the function address.  */
  1498.     funexp = XEXP (DECL_RTL (fndecl), 0);
  1499.   else
  1500.     /* Generate an rtx (probably a pseudo-register) for the address.  */
  1501.     {
  1502.       funexp = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode, 0);
  1503.       free_temp_slots ();    /* FUNEXP can't be BLKmode */
  1504.       emit_queue ();
  1505.     }
  1506.  
  1507.   /* Figure out the register where the value, if any, will come back.  */
  1508.   valreg = 0;
  1509.   if (TYPE_MODE (TREE_TYPE (exp)) != VOIDmode
  1510.       && ! structure_value_addr)
  1511.     {
  1512.       if (pcc_struct_value)
  1513.     valreg = hard_function_value (build_pointer_type (TREE_TYPE (exp)),
  1514.                       fndecl);
  1515.       else
  1516.     valreg = hard_function_value (TREE_TYPE (exp), fndecl);
  1517.     }
  1518.  
  1519.   /* Precompute all register parameters.  It isn't safe to compute anything
  1520.      once we have started filling any specific hard regs. */
  1521.   reg_parm_seen = 0;
  1522.   for (i = 0; i < num_actuals; i++)
  1523.     if (args[i].reg != 0 && ! args[i].pass_on_stack)
  1524.       {
  1525.     enum machine_mode mode;
  1526.  
  1527.     reg_parm_seen = 1;
  1528.  
  1529.     if (args[i].value == 0)
  1530.       {
  1531.         args[i].value = expand_expr (args[i].tree_value, NULL_RTX,
  1532.                      VOIDmode, 0);
  1533.         preserve_temp_slots (args[i].value);
  1534.         free_temp_slots ();
  1535.  
  1536.         /* ANSI doesn't require a sequence point here,
  1537.            but PCC has one, so this will avoid some problems.  */
  1538.         emit_queue ();
  1539.       }
  1540.  
  1541.     /* If we are to promote the function arg to a wider mode,
  1542.        do it now.  */
  1543.     mode = (GET_CODE (args[i].reg) == EXPR_LIST 
  1544.         ? GET_MODE (XEXP (args[i].reg, 0)) : GET_MODE (args[i].reg));
  1545.  
  1546.     if (TYPE_MODE (TREE_TYPE (args[i].tree_value)) != mode)
  1547.       args[i].value = convert_to_mode (mode, args[i].value,
  1548.                        args[i].unsignedp);
  1549.       }
  1550.  
  1551. #if defined(ACCUMULATE_OUTGOING_ARGS) && defined(REG_PARM_STACK_SPACE)
  1552.   /* The argument list is the property of the called routine and it
  1553.      may clobber it.  If the fixed area has been used for previous
  1554.      parameters, we must save and restore it.
  1555.  
  1556.      Here we compute the boundary of the that needs to be saved, if any.  */
  1557.  
  1558. #ifdef ARGS_GROW_DOWNWARD
  1559.   for (i = 0; i < reg_parm_stack_space + 1; i++)
  1560. #else
  1561.   for (i = 0; i < reg_parm_stack_space; i++)
  1562. #endif
  1563.     {
  1564.       if (i >=  highest_outgoing_arg_in_use
  1565.       || stack_usage_map[i] == 0)
  1566.     continue;
  1567.  
  1568.       if (low_to_save == -1)
  1569.     low_to_save = i;
  1570.  
  1571.       high_to_save = i;
  1572.     }
  1573.  
  1574.   if (low_to_save >= 0)
  1575.     {
  1576.       int num_to_save = high_to_save - low_to_save + 1;
  1577.       enum machine_mode save_mode
  1578.     = mode_for_size (num_to_save * BITS_PER_UNIT, MODE_INT, 1);
  1579.       rtx stack_area;
  1580.  
  1581.       /* If we don't have the required alignment, must do this in BLKmode.  */
  1582.       if ((low_to_save & (MIN (GET_MODE_SIZE (save_mode),
  1583.                    BIGGEST_ALIGNMENT / UNITS_PER_WORD) - 1)))
  1584.     save_mode = BLKmode;
  1585.  
  1586.       stack_area = gen_rtx (MEM, save_mode,
  1587.                 memory_address (save_mode,
  1588.                         
  1589. #ifdef ARGS_GROW_DOWNWARD
  1590.                         plus_constant (argblock,
  1591.                                - high_to_save)
  1592. #else
  1593.                         plus_constant (argblock,
  1594.                                low_to_save)
  1595. #endif
  1596.                         ));
  1597.       if (save_mode == BLKmode)
  1598.     {
  1599.       save_area = assign_stack_temp (BLKmode, num_to_save, 1);
  1600.       emit_block_move (validize_mem (save_area), stack_area,
  1601.                GEN_INT (num_to_save),
  1602.                PARM_BOUNDARY / BITS_PER_UNIT);
  1603.     }
  1604.       else
  1605.     {
  1606.       save_area = gen_reg_rtx (save_mode);
  1607.       emit_move_insn (save_area, stack_area);
  1608.     }
  1609.     }
  1610. #endif
  1611.       
  1612.  
  1613.   /* Now store (and compute if necessary) all non-register parms.
  1614.      These come before register parms, since they can require block-moves,
  1615.      which could clobber the registers used for register parms.
  1616.      Parms which have partial registers are not stored here,
  1617.      but we do preallocate space here if they want that.  */
  1618.  
  1619.   for (i = 0; i < num_actuals; i++)
  1620.     if (args[i].reg == 0 || args[i].pass_on_stack)
  1621.       store_one_arg (&args[i], argblock, may_be_alloca,
  1622.              args_size.var != 0, fndecl, reg_parm_stack_space);
  1623.  
  1624.   /* Now store any partially-in-registers parm.
  1625.      This is the last place a block-move can happen.  */
  1626.   if (reg_parm_seen)
  1627.     for (i = 0; i < num_actuals; i++)
  1628.       if (args[i].partial != 0 && ! args[i].pass_on_stack)
  1629.     store_one_arg (&args[i], argblock, may_be_alloca,
  1630.                args_size.var != 0, fndecl, reg_parm_stack_space);
  1631.  
  1632. #ifndef PUSH_ARGS_REVERSED
  1633. #ifdef STACK_BOUNDARY
  1634.   /* If we pushed args in forward order, perform stack alignment
  1635.      after pushing the last arg.  */
  1636.   if (argblock == 0)
  1637.     anti_adjust_stack (GEN_INT (args_size.constant
  1638.                 - original_args_size.constant));
  1639. #endif
  1640. #endif
  1641.  
  1642.   /* If register arguments require space on the stack and stack space
  1643.      was not preallocated, allocate stack space here for arguments
  1644.      passed in registers.  */
  1645. #if ! defined(ALLOCATE_OUTGOING_ARGS) && defined(OUTGOING_REG_PARM_STACK_SPACE)
  1646.   if (must_preallocate == 0 && reg_parm_stack_space > 0)
  1647.     anti_adjust_stack (GEN_INT (reg_parm_stack_space));
  1648. #endif
  1649.  
  1650.   /* Pass the function the address in which to return a structure value.  */
  1651.   if (structure_value_addr && ! structure_value_addr_parm && ! is_pascal)
  1652.     {
  1653.       emit_move_insn (struct_value_rtx,
  1654.               force_reg (DPmode,
  1655.                  force_operand (structure_value_addr,
  1656.                         NULL_RTX)));
  1657.       if (GET_CODE (struct_value_rtx) == REG)
  1658.     {
  1659.       push_to_sequence (use_insns);
  1660.       emit_insn (gen_rtx (USE, VOIDmode, struct_value_rtx));
  1661.       use_insns = get_insns ();
  1662.       end_sequence ();
  1663.     }
  1664.     }
  1665.  
  1666.   /* Now do the register loads required for any wholly-register parms or any
  1667.      parms which are passed both on the stack and in a register.  Their
  1668.      expressions were already evaluated. 
  1669.  
  1670.      Mark all register-parms as living through the call, putting these USE
  1671.      insns in a list headed by USE_INSNS.  */
  1672.  
  1673.   for (i = 0; i < num_actuals; i++)
  1674.     {
  1675.       rtx list = args[i].reg;
  1676.       int partial = args[i].partial;
  1677.  
  1678.       while (list)
  1679.     {
  1680.       rtx reg;
  1681.       int nregs;
  1682.  
  1683.       /* Process each register that needs to get this arg.  */
  1684.       if (GET_CODE (list) == EXPR_LIST)
  1685.         reg = XEXP (list, 0), list = XEXP (list, 1);
  1686.       else
  1687.         reg = list, list = 0;
  1688.  
  1689.       /* Set to non-zero if must move a word at a time, even if just one
  1690.          word (e.g, partial == 1 && mode == DFmode).  Set to zero if
  1691.          we just use a normal move insn.  */
  1692.       nregs = (partial ? partial
  1693.            : (TYPE_MODE (TREE_TYPE (args[i].tree_value)) == BLKmode
  1694.               ? ((int_size_in_bytes (TREE_TYPE (args[i].tree_value))
  1695.               + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)
  1696.               : 0));
  1697.  
  1698.       /* If simple case, just do move.  If normal partial, store_one_arg
  1699.          has already loaded the register for us.  In all other cases,
  1700.          load the register(s) from memory.  */
  1701.  
  1702.       if (nregs == 0)
  1703.         emit_move_insn (reg, args[i].value);
  1704.       else if (args[i].partial == 0 || args[i].pass_on_stack)
  1705.         move_block_to_reg (REGNO (reg),
  1706.                    validize_mem (args[i].value), nregs,
  1707.                    TYPE_MODE (TREE_TYPE (args[i].tree_value)));
  1708.     
  1709.       push_to_sequence (use_insns);
  1710.       if (nregs == 0)
  1711.         emit_insn (gen_rtx (USE, VOIDmode, reg));
  1712.       else
  1713.         use_regs (REGNO (reg), nregs);
  1714.       use_insns = get_insns ();
  1715.       end_sequence ();
  1716.  
  1717.       /* PARTIAL referred only to the first register, so clear it for the
  1718.          next time.  */
  1719.       partial = 0;
  1720.     }
  1721.     }
  1722.  
  1723.   /* Perform postincrements before actually calling the function.  */
  1724.   emit_queue ();
  1725.  
  1726.   /* All arguments and registers used for the call must be set up by now!  */
  1727.  
  1728.   funexp = prepare_call_address (funexp, fndecl, &use_insns);
  1729.  
  1730.   /* Generate the actual call instruction.  */
  1731.   emit_call_1 (funexp, funtype, args_size.constant, struct_value_size,
  1732.            FUNCTION_ARG (args_so_far, VOIDmode, void_type_node, 1),
  1733.            valreg, old_inhibit_defer_pop, use_insns, is_const,
  1734.            /* Extra args used by Apple hacks. */
  1735.            is_pascal, pascal_return_mode, structure_value_addr);
  1736.  
  1737.   /* If call is cse'able, make appropriate pair of reg-notes around it.
  1738.      Test valreg so we don't crash; may safely ignore `const'
  1739.      if return type is void.  */
  1740.   if (is_const && valreg != 0)
  1741.     {
  1742.       rtx note = 0;
  1743.       rtx temp = gen_reg_rtx (GET_MODE (valreg));
  1744.       rtx insns;
  1745.  
  1746.       /* Construct an "equal form" for the value which mentions all the
  1747.      arguments in order as well as the function name.  */
  1748. #ifdef PUSH_ARGS_REVERSED
  1749.       for (i = 0; i < num_actuals; i++)
  1750.     note = gen_rtx (EXPR_LIST, VOIDmode, args[i].initial_value, note);
  1751. #else
  1752.       for (i = num_actuals - 1; i >= 0; i--)
  1753.     note = gen_rtx (EXPR_LIST, VOIDmode, args[i].initial_value, note);
  1754. #endif
  1755.       note = gen_rtx (EXPR_LIST, VOIDmode, funexp, note);
  1756.  
  1757.       insns = get_insns ();
  1758.       end_sequence ();
  1759.  
  1760.       emit_libcall_block (insns, temp, valreg, note);
  1761.  
  1762.       valreg = temp;
  1763.     }
  1764.  
  1765.   /* For calls to `setjmp', etc., inform flow.c it should complain
  1766.      if nonvolatile values are live.  */
  1767.  
  1768.   if (returns_twice)
  1769.     {
  1770.       emit_note (name, NOTE_INSN_SETJMP);
  1771.       current_function_calls_setjmp = 1;
  1772.     }
  1773.  
  1774.   if (is_longjmp)
  1775.     current_function_calls_longjmp = 1;
  1776.  
  1777.   /* Notice functions that cannot return.
  1778.      If optimizing, insns emitted below will be dead.
  1779.      If not optimizing, they will exist, which is useful
  1780.      if the user uses the `return' command in the debugger.  */
  1781.  
  1782.   if (is_volatile || is_longjmp)
  1783.     emit_barrier ();
  1784.  
  1785.   /* If value type not void, return an rtx for the value.  */
  1786.  
  1787.   /* If there are cleanups to be called, don't use a hard reg as target.  */
  1788.   if (cleanups_this_call != old_cleanups
  1789.       && target && REG_P (target)
  1790.       && REGNO (target) < FIRST_PSEUDO_REGISTER)
  1791.     target = 0;
  1792.  
  1793.   if (TYPE_MODE (TREE_TYPE (exp)) == VOIDmode
  1794.       || ignore)
  1795.     {
  1796.       target = const0_rtx;
  1797.     }
  1798.   else if (structure_value_addr)
  1799.     {
  1800.       if (target == 0 || GET_CODE (target) != MEM)
  1801.     {
  1802.       target = gen_rtx (MEM, TYPE_MODE (TREE_TYPE (exp)),
  1803.                 memory_address (TYPE_MODE (TREE_TYPE (exp)),
  1804.                         structure_value_addr));
  1805.       MEM_IN_STRUCT_P (target)
  1806.         = (TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE
  1807.            || TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE
  1808.            || TREE_CODE (TREE_TYPE (exp)) == UNION_TYPE);
  1809.     }
  1810.     }
  1811.   else if (pcc_struct_value)
  1812.     {
  1813.       if (target == 0)
  1814.     {
  1815.       target = gen_rtx (MEM, TYPE_MODE (TREE_TYPE (exp)),
  1816.                 copy_to_reg (valreg));
  1817.       MEM_IN_STRUCT_P (target)
  1818.         = (TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE
  1819.            || TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE
  1820.            || TREE_CODE (TREE_TYPE (exp)) == UNION_TYPE);
  1821.     }
  1822.       else if (TYPE_MODE (TREE_TYPE (exp)) != BLKmode)
  1823.     emit_move_insn (target, gen_rtx (MEM, TYPE_MODE (TREE_TYPE (exp)),
  1824.                      copy_to_reg (valreg)));
  1825.       else
  1826.     emit_block_move (target, gen_rtx (MEM, BLKmode, copy_to_reg (valreg)),
  1827.              expr_size (exp),
  1828.              TYPE_ALIGN (TREE_TYPE (exp)) / BITS_PER_UNIT);
  1829.     }
  1830.   else if (target && GET_MODE (target) == TYPE_MODE (TREE_TYPE (exp))
  1831.        && GET_MODE (target) == GET_MODE (valreg))
  1832.     /* TARGET and VALREG cannot be equal at this point because the latter
  1833.        would not have REG_FUNCTION_VALUE_P true, while the former would if
  1834.        it were referring to the same register.
  1835.  
  1836.        If they refer to the same register, this move will be a no-op, except
  1837.        when function inlining is being done.  */
  1838.     emit_move_insn (target, valreg);
  1839.   else
  1840.     target = copy_to_reg (valreg);
  1841.  
  1842. #ifdef PROMOTE_FUNCTION_RETURN
  1843.   /* If we promoted this return value, make the proper SUBREG.  */
  1844.   if (GET_MODE (target) != TYPE_MODE (TREE_TYPE (exp)))
  1845.     {
  1846.       enum machine_mode mode = GET_MODE (target);
  1847.       int unsignedp = TREE_UNSIGNED (TREE_TYPE (exp));
  1848.  
  1849.       if (TREE_CODE (TREE_TYPE (exp)) == INTEGER_TYPE
  1850.       || TREE_CODE (TREE_TYPE (exp)) == ENUMERAL_TYPE
  1851.       || TREE_CODE (TREE_TYPE (exp)) == BOOLEAN_TYPE
  1852.       || TREE_CODE (TREE_TYPE (exp)) == CHAR_TYPE
  1853.       || TREE_CODE (TREE_TYPE (exp)) == REAL_TYPE
  1854.       || TREE_CODE (TREE_TYPE (exp)) == POINTER_TYPE
  1855.       || TREE_CODE (TREE_TYPE (exp)) == OFFSET_TYPE)
  1856.     {
  1857.       PROMOTE_MODE (mode, unsignedp, TREE_TYPE (exp));
  1858.     }
  1859.  
  1860.       target = gen_rtx (SUBREG, TYPE_MODE (TREE_TYPE (exp)), target, 0);
  1861.       SUBREG_PROMOTED_VAR_P (target) = 1;
  1862.       SUBREG_PROMOTED_UNSIGNED_P (target) = unsignedp;
  1863.     }
  1864. #endif
  1865.  
  1866.   /* Perform all cleanups needed for the arguments of this call
  1867.      (i.e. destructors in C++).  */
  1868.   expand_cleanups_to (old_cleanups);
  1869.  
  1870.   /* If size of args is variable or this was a constructor call for a stack
  1871.      argument, restore saved stack-pointer value.  */
  1872.  
  1873.   if (old_stack_level)
  1874.     {
  1875.       emit_stack_restore (SAVE_BLOCK, old_stack_level, NULL_RTX);
  1876.       pending_stack_adjust = old_pending_adj;
  1877. #ifdef ACCUMULATE_OUTGOING_ARGS
  1878.       stack_arg_under_construction = old_stack_arg_under_construction;
  1879.       highest_outgoing_arg_in_use = initial_highest_arg_in_use;
  1880.       stack_usage_map = initial_stack_usage_map;
  1881. #endif
  1882.     }
  1883. #ifdef ACCUMULATE_OUTGOING_ARGS
  1884.   else
  1885.     {
  1886. #ifdef REG_PARM_STACK_SPACE
  1887.       if (save_area)
  1888.     {
  1889.       enum machine_mode save_mode = GET_MODE (save_area);
  1890.       rtx stack_area
  1891.         = gen_rtx (MEM, save_mode,
  1892.                memory_address (save_mode,
  1893. #ifdef ARGS_GROW_DOWNWARD
  1894.                        plus_constant (argblock, - high_to_save)
  1895. #else
  1896.                        plus_constant (argblock, low_to_save)
  1897. #endif
  1898.                        ));
  1899.  
  1900.       if (save_mode != BLKmode)
  1901.         emit_move_insn (stack_area, save_area);
  1902.       else
  1903.         emit_block_move (stack_area, validize_mem (save_area),
  1904.                  GEN_INT (high_to_save - low_to_save + 1),
  1905.                  PARM_BOUNDARY / BITS_PER_UNIT);
  1906.     }
  1907. #endif
  1908.       
  1909.       /* If we saved any argument areas, restore them.  */
  1910.       for (i = 0; i < num_actuals; i++)
  1911.     if (args[i].save_area)
  1912.       {
  1913.         enum machine_mode save_mode = GET_MODE (args[i].save_area);
  1914.         rtx stack_area
  1915.           = gen_rtx (MEM, save_mode,
  1916.              memory_address (save_mode,
  1917.                      XEXP (args[i].stack_slot, 0)));
  1918.  
  1919.         if (save_mode != BLKmode)
  1920.           emit_move_insn (stack_area, args[i].save_area);
  1921.         else
  1922.           emit_block_move (stack_area, validize_mem (args[i].save_area),
  1923.                    GEN_INT (args[i].size.constant),
  1924.                    PARM_BOUNDARY / BITS_PER_UNIT);
  1925.       }
  1926.  
  1927.       highest_outgoing_arg_in_use = initial_highest_arg_in_use;
  1928.       stack_usage_map = initial_stack_usage_map;
  1929.     }
  1930. #endif
  1931.  
  1932.   /* If this was alloca, record the new stack level for nonlocal gotos.  
  1933.      Check for the handler slots since we might not have a save area
  1934.      for non-local gotos. */
  1935.  
  1936.   if (may_be_alloca && nonlocal_goto_handler_slot != 0)
  1937.     emit_stack_save (SAVE_NONLOCAL, &nonlocal_goto_stack_level, NULL_RTX);
  1938.  
  1939.   pop_temp_slots ();
  1940.  
  1941.   return target;
  1942. }
  1943.  
  1944. #if 0
  1945. /* Return an rtx which represents a suitable home on the stack
  1946.    given TYPE, the type of the argument looking for a home.
  1947.    This is called only for BLKmode arguments.
  1948.  
  1949.    SIZE is the size needed for this target.
  1950.    ARGS_ADDR is the address of the bottom of the argument block for this call.
  1951.    OFFSET describes this parameter's offset into ARGS_ADDR.  It is meaningless
  1952.    if this machine uses push insns.  */
  1953.  
  1954. static rtx
  1955. target_for_arg (type, size, args_addr, offset)
  1956.      tree type;
  1957.      rtx size;
  1958.      rtx args_addr;
  1959.      struct args_size offset;
  1960. {
  1961.   rtx target;
  1962.   rtx offset_rtx = ARGS_SIZE_RTX (offset);
  1963.  
  1964.   /* We do not call memory_address if possible,
  1965.      because we want to address as close to the stack
  1966.      as possible.  For non-variable sized arguments,
  1967.      this will be stack-pointer relative addressing.  */
  1968.   if (GET_CODE (offset_rtx) == CONST_INT)
  1969.     target = plus_constant (args_addr, INTVAL (offset_rtx));
  1970.   else
  1971.     {
  1972.       /* I have no idea how to guarantee that this
  1973.      will work in the presence of register parameters.  */
  1974.       target = gen_rtx (PLUS, DPmode, args_addr, offset_rtx);
  1975.       target = memory_address (QImode, target);
  1976.     }
  1977.  
  1978.   return gen_rtx (MEM, BLKmode, target);
  1979. }
  1980. #endif
  1981.  
  1982. /* Store a single argument for a function call
  1983.    into the register or memory area where it must be passed.
  1984.    *ARG describes the argument value and where to pass it.
  1985.  
  1986.    ARGBLOCK is the address of the stack-block for all the arguments,
  1987.    or 0 on a machine where arguments are pushed individually.
  1988.  
  1989.    MAY_BE_ALLOCA nonzero says this could be a call to `alloca'
  1990.    so must be careful about how the stack is used. 
  1991.  
  1992.    VARIABLE_SIZE nonzero says that this was a variable-sized outgoing
  1993.    argument stack.  This is used if ACCUMULATE_OUTGOING_ARGS to indicate
  1994.    that we need not worry about saving and restoring the stack.
  1995.  
  1996.    FNDECL is the declaration of the function we are calling.  */
  1997.  
  1998. static void
  1999. store_one_arg (arg, argblock, may_be_alloca, variable_size, fndecl,
  2000.            reg_parm_stack_space)
  2001.      struct arg_data *arg;
  2002.      rtx argblock;
  2003.      int may_be_alloca;
  2004.      int variable_size;
  2005.      tree fndecl;
  2006.      int reg_parm_stack_space;
  2007. {
  2008.   register tree pval = arg->tree_value;
  2009.   rtx reg = 0;
  2010.   int partial = 0;
  2011.   int used = 0;
  2012.   int i, lower_bound, upper_bound;
  2013.  
  2014.   if (TREE_CODE (pval) == ERROR_MARK)
  2015.     return;
  2016.  
  2017. #ifdef ACCUMULATE_OUTGOING_ARGS
  2018.   /* If this is being stored into a pre-allocated, fixed-size, stack area,
  2019.      save any previous data at that location.  */
  2020.   if (argblock && ! variable_size && arg->stack)
  2021.     {
  2022. #ifdef ARGS_GROW_DOWNWARD
  2023.       /* stack_slot is negative, but we want to index stack_usage_map */
  2024.       /* with positive values. */
  2025.       if (GET_CODE (XEXP (arg->stack_slot, 0)) == PLUS)
  2026.     upper_bound = -INTVAL (XEXP (XEXP (arg->stack_slot, 0), 1)) + 1;
  2027.       else
  2028.     abort ();
  2029.  
  2030.       lower_bound = upper_bound - arg->size.constant;
  2031. #else
  2032.       if (GET_CODE (XEXP (arg->stack_slot, 0)) == PLUS)
  2033.     lower_bound = INTVAL (XEXP (XEXP (arg->stack_slot, 0), 1));
  2034.       else
  2035.     lower_bound = 0;
  2036.  
  2037.       upper_bound = lower_bound + arg->size.constant;
  2038. #endif
  2039.  
  2040.       for (i = lower_bound; i < upper_bound; i++)
  2041.     if (stack_usage_map[i]
  2042. #ifdef REG_PARM_STACK_SPACE
  2043.         /* Don't store things in the fixed argument area at this point;
  2044.            it has already been saved.  */
  2045.         && i > reg_parm_stack_space
  2046. #endif
  2047.         )
  2048.       break;
  2049.  
  2050.       if (i != upper_bound)
  2051.     {
  2052.       /* We need to make a save area.  See what mode we can make it.  */
  2053.       enum machine_mode save_mode
  2054.         = mode_for_size (arg->size.constant * BITS_PER_UNIT, MODE_INT, 1);
  2055.       rtx stack_area
  2056.         = gen_rtx (MEM, save_mode,
  2057.                memory_address (save_mode, XEXP (arg->stack_slot, 0)));
  2058.  
  2059.       if (save_mode == BLKmode)
  2060.         {
  2061.           arg->save_area = assign_stack_temp (BLKmode,
  2062.                           arg->size.constant, 1);
  2063.           emit_block_move (validize_mem (arg->save_area), stack_area,
  2064.                    GEN_INT (arg->size.constant),
  2065.                    PARM_BOUNDARY / BITS_PER_UNIT);
  2066.         }
  2067.       else
  2068.         {
  2069.           arg->save_area = gen_reg_rtx (save_mode);
  2070.           emit_move_insn (arg->save_area, stack_area);
  2071.         }
  2072.     }
  2073.     }
  2074. #endif
  2075.  
  2076.   /* If this isn't going to be placed on both the stack and in registers,
  2077.      set up the register and number of words.  */
  2078.   if (! arg->pass_on_stack)
  2079.     reg = arg->reg, partial = arg->partial;
  2080.  
  2081.   if (reg != 0 && partial == 0)
  2082.     /* Being passed entirely in a register.  We shouldn't be called in
  2083.        this case.   */
  2084.     abort ();
  2085.  
  2086.   /* If this is being partially passed in a register, but multiple locations
  2087.      are specified, we assume that the one partially used is the one that is
  2088.      listed first.  */
  2089.   if (reg && GET_CODE (reg) == EXPR_LIST)
  2090.     reg = XEXP (reg, 0);
  2091.  
  2092.   /* If this is being passes partially in a register, we can't evaluate
  2093.      it directly into its stack slot.  Otherwise, we can.  */
  2094.   if (arg->value == 0)
  2095.     {
  2096. #ifdef ACCUMULATE_OUTGOING_ARGS
  2097.       /* stack_arg_under_construction is nonzero if a function argument is
  2098.      being evaluated directly into the outgoing argument list and
  2099.      expand_call must take special action to preserve the argument list
  2100.      if it is called recursively.
  2101.  
  2102.      For scalar function arguments stack_usage_map is sufficient to
  2103.      determine which stack slots must be saved and restored.  Scalar
  2104.      arguments in general have pass_on_stack == 0.
  2105.  
  2106.      If this argument is initialized by a function which takes the
  2107.      address of the argument (a C++ constructor or a C function
  2108.      returning a BLKmode structure), then stack_usage_map is
  2109.      insufficient and expand_call must push the stack around the
  2110.      function call.  Such arguments have pass_on_stack == 1.
  2111.  
  2112.      Note that it is always safe to set stack_arg_under_construction,
  2113.      but this generates suboptimal code if set when not needed.  */
  2114.  
  2115.       if (arg->pass_on_stack)
  2116.     stack_arg_under_construction++;
  2117. #endif
  2118.       arg->value = expand_expr (pval, partial ? NULL_RTX : arg->stack,
  2119.                 VOIDmode, 0);
  2120. #ifdef ACCUMULATE_OUTGOING_ARGS
  2121.       if (arg->pass_on_stack)
  2122.     stack_arg_under_construction--;
  2123. #endif
  2124.     }
  2125.  
  2126.   /* Don't allow anything left on stack from computation
  2127.      of argument to alloca.  */
  2128.   if (may_be_alloca)
  2129.     do_pending_stack_adjust ();
  2130.  
  2131.   if (arg->value == arg->stack)
  2132.     /* If the value is already in the stack slot, we are done.  */
  2133.     ;
  2134.   else if (TYPE_MODE (TREE_TYPE (pval)) != BLKmode)
  2135.     {
  2136.       register int size;
  2137.  
  2138.       /* Argument is a scalar, not entirely passed in registers.
  2139.      (If part is passed in registers, arg->partial says how much
  2140.      and emit_push_insn will take care of putting it there.)
  2141.      
  2142.      Push it, and if its size is less than the
  2143.      amount of space allocated to it,
  2144.      also bump stack pointer by the additional space.
  2145.      Note that in C the default argument promotions
  2146.      will prevent such mismatches.  */
  2147.  
  2148.       size = GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (pval)));
  2149.       /* Compute how much space the push instruction will push.
  2150.      On many machines, pushing a byte will advance the stack
  2151.      pointer by a halfword.  */
  2152. #ifdef PUSH_ROUNDING
  2153.       size = PUSH_ROUNDING (size);
  2154. #endif
  2155.       used = size;
  2156.  
  2157.       /* Compute how much space the argument should get:
  2158.      round up to a multiple of the alignment for arguments.  */
  2159.       if (none != FUNCTION_ARG_PADDING (TYPE_MODE (TREE_TYPE (pval)),
  2160.                     TREE_TYPE (pval)))
  2161.     used = (((size + PARM_BOUNDARY / BITS_PER_UNIT - 1)
  2162.          / (PARM_BOUNDARY / BITS_PER_UNIT))
  2163.         * (PARM_BOUNDARY / BITS_PER_UNIT));
  2164.  
  2165.       /* This isn't already where we want it on the stack, so put it there.
  2166.      This can either be done with push or copy insns.  */
  2167.       emit_push_insn (arg->value, TYPE_MODE (TREE_TYPE (pval)),
  2168.               TREE_TYPE (pval), 0, 0, partial, reg,
  2169.               used - size, argblock, ARGS_SIZE_RTX (arg->offset));
  2170.     }
  2171.   else
  2172.     {
  2173.       /* BLKmode, at least partly to be pushed.  */
  2174.  
  2175.       register int excess;
  2176.       rtx size_rtx;
  2177.  
  2178.       /* Pushing a nonscalar.
  2179.      If part is passed in registers, PARTIAL says how much
  2180.      and emit_push_insn will take care of putting it there.  */
  2181.  
  2182.       /* Round its size up to a multiple
  2183.      of the allocation unit for arguments.  */
  2184.  
  2185.       if (arg->size.var != 0)
  2186.     {
  2187.       excess = 0;
  2188.       size_rtx = ARGS_SIZE_RTX (arg->size);
  2189.     }
  2190.       else
  2191.     {
  2192.       register tree size = size_in_bytes (TREE_TYPE (pval));
  2193.       /* PUSH_ROUNDING has no effect on us, because
  2194.          emit_push_insn for BLKmode is careful to avoid it.  */
  2195.       excess = (arg->size.constant - TREE_INT_CST_LOW (size)
  2196.             + partial * UNITS_PER_WORD);
  2197.       size_rtx = expand_expr (size, NULL_RTX, VOIDmode, 0);
  2198.     }
  2199.  
  2200.       emit_push_insn (arg->value, TYPE_MODE (TREE_TYPE (pval)),
  2201.               TREE_TYPE (pval), size_rtx,
  2202.               TYPE_ALIGN (TREE_TYPE (pval)) / BITS_PER_UNIT, partial,
  2203.               reg, excess, argblock, ARGS_SIZE_RTX (arg->offset));
  2204.     }
  2205.  
  2206.  
  2207.   /* Unless this is a partially-in-register argument, the argument is now
  2208.      in the stack. 
  2209.  
  2210.      ??? Note that this can change arg->value from arg->stack to
  2211.      arg->stack_slot and it matters when they are not the same.
  2212.      It isn't totally clear that this is correct in all cases.  */
  2213.   if (partial == 0)
  2214.     arg->value = arg->stack_slot;
  2215.  
  2216.   /* Once we have pushed something, pops can't safely
  2217.      be deferred during the rest of the arguments.  */
  2218.   NO_DEFER_POP;
  2219.  
  2220.   /* ANSI doesn't require a sequence point here,
  2221.      but PCC has one, so this will avoid some problems.  */
  2222.   emit_queue ();
  2223.  
  2224.   /* Free any temporary slots made in processing this argument.  */
  2225.   free_temp_slots ();
  2226.  
  2227. #ifdef ACCUMULATE_OUTGOING_ARGS
  2228.   /* Now mark the segment we just used.  */
  2229.   if (argblock && ! variable_size && arg->stack)
  2230.     for (i = lower_bound; i < upper_bound; i++)
  2231.       stack_usage_map[i] = 1;
  2232. #endif
  2233. }
  2234.